package me.cloudcat.eurekaclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.ws.rs.Produces;

/**
 * @Author: jiafeim12345@163.com
 * @Date: 2018/3/25/025 17:13
 */
@RestController
@Produces("application/json")
public class HelloWorldController {

    @Value("${server.port}")
    Integer port;

    @RequestMapping(value = "/hi", method = RequestMethod.GET)
    public String testOne(Model model) {
        // 设定延时，测试熔断
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "Hi, I am client: " + port;
    }

}
